<template>
  <div>
    <h1 v-text="welcomeMsg" ref="title"></h1>
    <button @click="showDOM">点我输出上方的DOM元素</button>
    <school-vue ref="sch"></school-vue>
    <student-vue/>
  </div>
</template>

<script>
import StudentVue from './components/StudentVue.vue';
import SchoolVue from "./components/SchoolVue.vue";

export default {
  name: "App",
  components: {
    SchoolVue,StudentVue
  },
  data() {
    return {
      welcomeMsg: "欢迎学习Vue!",
    };
  },
  methods: {
    showDOM() {
        console.log('@@');
        console.log(this.$refs.title)// 真实DOM
        console.log(this.$refs.sch);// School组件的实例对象(VC)
    },
  },
};
</script>

<style>
</style>